import request from '@/config/axios'

// 品牌 VO
export interface BrandVO {
  id: number // 序号
  name: string // 名称
  logo: string // LOGO
  introduce: string // 简介
  major: string // 主营品类
  sort: number // 排序
  status: number // 状态
  remark: string // 备注
}

// 品牌 API
export const BrandApi = {
  // 查询品牌分页
  getBrandPage: async (params: any) => {
    return await request.get({ url: `/aib/brand/page`, params })
  },

  // 查询品牌精简列表
  getBrandSimpleList: async () => {
    return await request.get({ url: `/aib/brand/simple-list` })
  },

  // 查询品牌详情
  getBrand: async (id: number) => {
    return await request.get({ url: `/aib/brand/get?id=` + id })
  },

  // 新增品牌
  createBrand: async (data: BrandVO) => {
    return await request.post({ url: `/aib/brand/create`, data })
  },

  // 修改品牌
  updateBrand: async (data: BrandVO) => {
    return await request.put({ url: `/aib/brand/update`, data })
  },

  // 删除品牌
  deleteBrand: async (id: number) => {
    return await request.delete({ url: `/aib/brand/delete?id=` + id })
  },

  // 导出品牌 Excel
  exportBrand: async (params) => {
    return await request.download({ url: `/aib/brand/export-excel`, params })
  },
}
